<style type="text/css">
.carousel-inner .item img{
	max-width: 100%;
    max-height: 100%;
    vertical-align: middle;
	height:82px;
}
.star-rate {margin-left:0}
.fe-floatright-bottom a {
    display: block;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 100%;
    background-color: #ff9999;
    color: #fff;
    line-height: 0.7rem;
	font-size:0.45rem;
    margin: 0.5rem auto;
    margin-right: 0;
}
.fe-floatright-bottom a .icon {
    color: #fff;
    font-size: 0.6rem;
    height: 0.6rem;
	line-height: 1rem;
    opacity: 1;
}
</style>

<div class="fui-page-group ">
<div class="fui-page fui-page-current page-goods-list">
	<div class='fui-content' style="background:#fff">
		<div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true">
				<div class="carousel-inner" role="listbox" style="height:6rem">
				<div>
					<a href="#">
						<img src="{{tomedia(pagedata.lesson.image) || '../core/resource/images/banner-1.jpg'}}" style="display: block; width: 100%; height: 100%;">
					</a>
				</div>
				</div>
		</div>

		<div class="bd">
			<div class="weui_cells_title">课程简介</div>
			<div class="weui_cells">
				<div class="weui_cell">
					<div class="weui_cell_bd weui_cell_primary">
						<span>{{pagedata.lesson.description}}</span>
					</div>           
				</div>
			</div>
		</div>
		<div class="lynn_goods_content" style="padding:0.5rem">
				<div class="lynn_goods_content_title bold"><span>课程介绍</span></div>
				<div ng-if="pagedata.lesson.content" class="lynn_goods_content_info content-images" ng-bind-html="trust(pagedata.lesson.content)">
				</div>
		</div>
		<div style="height:2.5rem;"></div>
	</div>
	<div class="fui-navbar">
		<a href="javascript:;" ng-click="access_json('jy_bdd/select_store//id='+pagedata.lesson.id)"  class="nav-item" style="background:#CCFF00;color:#000">去约课</a>
	</div>
</div>
<script type="text/javascript">
require(['bootstrap', 'hammer'], function($, Hammer){
		$('#carousel-container').carousel();
		var mc = new Hammer($('#carousel-container').get(0));
		mc.on("panleft", function(ev) {
			$('#carousel-container').carousel('next');
		});
		mc.on("panright", function(ev) {
			$('#carousel-container').carousel('prev');
		});
	}); 
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
scope.loading = true;
    // 百度地图API功能
window.scope.location(function(re){
	if(!scope.pagedata.pcd.city){
		scope.$apply(function(){
			scope.pagedata.pcd.province = re.addressComponents.province;
			scope.pagedata.pcd.city = re.addressComponents.city;
		});
	}
	scope.pagedata.lat_lng=re.lat_lng
	var data={
	'data':{'lat_lng':re.lat_lng},
	'op':'getlist',
	};
	data.callback=function(d){
		window.scope.pagedata.list=d.list;
		scope.loading = false;
		scope.$apply();
	}
	window.scope.post_json(data);
});
scope.selectarea = function(province,city,district){
	//scope.$apply(function(){
		scope.pagedata.pcd.province = province;
		scope.pagedata.pcd.city = city;
		scope.pagedata.pcd.district = district;
		scope.getlist('',province,city);
	//});
}	
scope.scroll(function(){
		scope.$apply();
		setTimeout('getlist()',2000);
},false,'svposttext');
var page = 1;
scope.getlist=function (key,province,city){
	if(key){
		page=1
		scope.pagedata.list=[]
	}
	var params = {
				'plugin':'jy_bdd',
				'action':'store_list',
				'op':'getlist',
				'data':{
						'keyword':key?key:'',
						'province':province,
						'city':city,
						'lat_lng':scope.pagedata.lat_lng
				},
				'callback':function(data){
							if(data.error !=1){
							 for (var i=0;i<data.list.length;i++){
									scope.pagedata.list.push(data.list[i]);
								}
								if(page >1){
									$(".merchgroup").animate({scrollTop:0},300);
								}
								page++;
								scope.loading = false;
								window.scope.pagedata.list=data.list;
								scope.$apply();
							}else{
								onsole.log('error');
							};
				}
	}
	scope.post_json(params);
} 
//手机软键盘--搜索
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
</script>